package cms.manage.template.value.impl;

import cms.bean.template.Forum;
import cms.manage.template.impl.FeedbackTemplateManage;
import cms.manage.template.value.TplValueStrategy;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Map;

import static cms.common.SystemConstant.DisplayType.DISPLAY_COLLECTION;

@Service("在线留言")
public class FeedbackStrategy implements TplValueStrategy<Map<String,Object>> {
    @Resource
    FeedbackTemplateManage feedbackTemplateManage;
    @Override
    public Map<String,Object> doOperation(Forum forum, Map submitParameter, Map runtimeParameter) {
        if(forum.getForumChildType().equals("添加在线留言")){
            if(forum.getDisplayType().equals(DISPLAY_COLLECTION.getValue())){//集合
                Map<String,Object> value = feedbackTemplateManage.addFeedbackCollection(forum, submitParameter,runtimeParameter);
                return value;
            }
        }
        return null;
    }
}
